﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication
{
    public partial class Real_Estate_Search : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                CountryService service = new CountryService();
                List<string> country = service.GetCountry();
                ddlCountry.DataSource = country;
                ddlCountry.DataBind();
                ddlCountry.Items.Insert(0, "Country");
            }
            if (Session["UserID"].ToString() != "Guest")
            {
                ((System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("divbreadcrum")).InnerHtml = @"<a href='Menu.aspx'>Home</a> >  <a href='menu.aspx'>Menu</a> > <span>Real Estate Search</span>";
            }
            else
            {
                ((System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("divbreadcrum")).InnerHtml = @"<a href='default.aspx'>Home</a> >  <a href='menu.aspx'>Menu</a> > <span>Real Estate Search</span>";
            }
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string country = Request.Form.Get("ctl00$MainContent$ddlCountry");
            string city = Request.Form.Get("ctl00$MainContent$ddlCity");
            Response.Redirect("Real_Estate_Search_Menu.aspx?co=" + country+"&c="+city);
        }
    }
}